<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<ui:composition template="/template/layout.xhtml">
	<ui:define name="conteudo">
		<br />
		<br />
		<div id="path">
			<h1>Cadastro Usuário</h1>
			<hr />
		</div>
		<h:form>
			<br />
			<br />
			<br />
			<p:messages autoUpdate="true"/>
			<fieldset>
				<legend>Dados</legend>
				<br />
				<br />
				<h:panelGrid columns="3">
					<h:outputLabel value="Nome:" for="nome" styleClass="label" />
					<h:inputText id="nome" class="rotulos" size="70"
						value="#{usuarioBean.usuario.nome}" required="true"
						requiredMessage="* O campo [Nome] é obrigatório!" />
					<br/>

					<h:outputLabel value="Área de Interesse:" for="area"
						styleClass="label" />
					<h:selectOneMenu id="area" value="#{usuarioBean.usuario.area}" required="true" requiredMessage="* O campo [Área] é obrigatório!">
						<f:selectItems value="#{areaBean.areas}" var="#{area}" itemValue="#{area}" />		
						<f:converter converterId="simpleEntityConverter"/>
					</h:selectOneMenu> 	
					<br />

					<h:outputLabel value="Email Principal:" for="email"
						styleClass="label" />
					<h:inputText id="email" class="rotulos" size="40"
						value="#{usuarioBean.usuario.email}" required="true"
						requiredMessage="* O campo [Email] é obrigatório!" />
					<br/>

					<h:outputLabel value="Email Opcional:" for="emailopcional"
						styleClass="label" />
					<h:inputText id="emailopcional" class="rotulos" size="40"
						value="#{usuarioBean.usuario.emailopcional}" />
					<br />

					<h:outputLabel value="Login:" for="user" styleClass="label" />
					<h:inputText id="user" class="rotulos"
						value="#{usuarioBean.usuario.user}" required="true"
						requiredMessage="* O campo [Login] é obrigatório!" />
					<br/>

					<h:outputLabel value="Senha:" for="senha" styleClass="label" />
					<h:inputSecret id="senha" class="rotulos"
						value="#{usuarioBean.usuario.senha}" required="true"
						requiredMessage="* O campo [Senha] é obrigatório!" />
					<br/>

				</h:panelGrid>
				<br />
				<br />
				<h:commandButton class="botaolimpar" value="Limpar"
					image="../resources/imagens/botoes/botao-limpar.png"
					immediate="true">
					<f:ajax render="@form"></f:ajax>
				</h:commandButton>
				<h:commandButton class="botaosalvar" value="Salvar"
					image="../resources/imagens/botoes/botao-salvar.png"
					action="#{usuarioBean.actionCadastrar}"></h:commandButton>
			</fieldset>
		</h:form>


	</ui:define>
</ui:composition>
</html>